package gui.customizepanel;

import javax.swing.GroupLayout;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.table.DefaultTableModel;

public class JSentMailPanel extends JPanel {

	private static final long serialVersionUID = 0xA1L;

	private JScrollPane scroll_sent;
	private JTable tbl_sent;

	private static JSentMailPanel instance;

	public static final JSentMailPanel getInstance() {
		if (instance == null)
			return instance = new JSentMailPanel();
		return instance;
	}

	private JSentMailPanel() {
		initComponents();
	}

	private void newComps() {
		scroll_sent = new JScrollPane();
		tbl_sent = new JTable();
	}

	private void setCompsProperties() {
		tbl_sent.setModel(new DefaultTableModel(new Object[][] { { null, null,
				null, null, null } }, new String[] { "From", "Subject", "To",
				"Attachment", "Date" }));
		scroll_sent.setViewportView(tbl_sent);
	}

	private void setMainLayout() {
		GroupLayout layout = new GroupLayout(this);
		this.setLayout(layout);
		layout.setHorizontalGroup(layout.createParallelGroup(
				GroupLayout.Alignment.LEADING).addGroup(
				layout.createSequentialGroup()
						.addContainerGap()
						.addComponent(scroll_sent, GroupLayout.DEFAULT_SIZE,
								1076, Short.MAX_VALUE).addContainerGap()));
		layout.setVerticalGroup(layout.createParallelGroup(
				GroupLayout.Alignment.LEADING).addGroup(
				layout.createSequentialGroup()
						.addContainerGap()
						.addComponent(scroll_sent, GroupLayout.DEFAULT_SIZE,
								646, Short.MAX_VALUE).addContainerGap()));
	}

	private void initComponents() {
		newComps();
		setCompsProperties();
		setMainLayout();
	}

}
